<table width="100%">
<tr>
<td align="right" colspan="4"><?echo getPlayerValidityKey();?></td>
</tr>
<?php
$currentRound = getCurrentRound();
$round = $currentRound;
if (isset($_GET['round'])) {
	$round = $_GET['round'];
}
$selectedTeams = getSelectedTeamsForWeek($leagueId, false, $round);
$count = count($selectedTeams);
for ($i = 0; $i < $count; $i++) {
?>
	<tr>
	<td>
		<h2><?echo $selectedTeams[$i]->teamName?></h2>
		<table width="100%" cellspacing="10">
			<tr>
				<td width="5%"><b>B:</b></td>
				<td width="30%"><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('LBP'), $round);?></td><td width="2%">|</td>
				<td width="30%"><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('FB'), $round);?></td><td width="2%">|</td>
				<td width="30%"><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('RBP'), $round);?></td>
			</tr>
			<tr>
				<td><b>HB:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('LHBF'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('CHB'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('RHBF'), $round);?></td>
			</tr>			
			<tr>
				<td><b>C:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('LW'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('C'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('RW'), $round);?></td>
			</tr>			
			<tr>
				<td><b>HF:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('LHFF'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('CHF'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('RHFF'), $round);?></td>
			</tr>			
			<tr>
				<td><b>F:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('LFP'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('FF'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('RFP'), $round);?></td>
			</tr>			
			<tr>
				<td><b>R:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('R'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('F1'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('F2'), $round);?></td>
			</tr>
			<tr>
				<td colspan="6"><hr></td>
			</tr>
			<tr>
				<td valign="top"><b>EMG:</b></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('E1'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('E2'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('E3'), $round);?></td>
			</tr>
			<tr>
				<td></td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('E4'), $round);?></td><td>|</td>
				<td><? echo getPlayerDisplay($selectedTeams[$i]->getPlayer('E5'), $round);?></td><td></td>
				<td></td>
			</tr>
			<tr>
				<td colspan="6"><hr></td>
			</tr>
			<tr>
				<td valign="top"><b>INS:</b></td>
				<td colspan="5">
				<?
				$count2 = count($selectedTeams[$i]->ins);
				for ($j = 0; $j < $count2; $j++) {
					if ($j > 0) {
						echo ", ";
					}
					echo getPlayerDisplayForPlayer($selectedTeams[$i]->ins[$j]);
				}
				?>
				</td>
			</tr>
			<tr>
				<td valign="top"><b>OUTS:</b></td>
				<td colspan="5">
				<?
				$count2 = count($selectedTeams[$i]->outs);
				for ($j = 0; $j < $count2; $j++) {
					if ($j > 0) {
						echo ", ";
					}
					echo getPlayerDisplayForPlayer($selectedTeams[$i]->outs[$j]);
				}
				?>
				</td>
			</tr>			
			<tr>
				<td valign="top"><b>RES:</b></td>
				<td colspan="5">
				<?
				$ltis = $selectedTeams[$i]->getLti();
				$ltiCount = count($ltis);
		
				$reserves = $selectedTeams[$i]->getReserves();
				$count2 = count($reserves);
				for ($j = 0; $j < $count2; $j++) {
					if ($j > 0) {
						echo ", ";
					}
					echo getPlayerDisplay($reserves[$j], $round);
				}
				?>
				</td>
			</tr>
			<?if ($ltiCount > 0) {?>	
			<tr>
				<td><b>LTI:</b></td>
				<td colspan="5">
				<?
				for ($k = 0; $k < $ltiCount; $k++) {
					if ($k > 0) {
						echo ", ";
					}
					echo getPlayerDisplay($ltis[$k], $round);
				}
				?>
				</td>
			</tr>
			<?}?>
			<tr>
				<td colspan="6"><hr></td>
			</tr>			
						
		</table>
		</td>
	</tr>
<?}?>
</table>